import unittest
import ddt

# https://blog.csdn.net/u013118036/article/details/45558951
from excel_r import ExcelUtil

excel = ExcelUtil(r'.\data.xlsx', 'Sheet1')


@ddt.ddt
class DataTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        print('start')

    @classmethod
    def tearDownClass(cls):
        print('stop')

    @ddt.data(*excel.next())
    def testLogin(self, data):
        print(data['username'])
        print(data['password'])
        print(data['country'])


if __name__ == "__main__":
    suite = unittest.TestLoader().loadTestsFromTestCase(DataTest)
    unittest.TextTestRunner(verbosity=2).run(suite)
    # unittestdemo.main()
